import { APP_UPLOAD_BASEURL } from '../app/config'
import { File } from '@koa/multer'
import Api from '../utils/Api'

class UploadService extends Api {
  /**
   * 文件上传
   */
  async upload(file: File) {
    const filePath = `${APP_UPLOAD_BASEURL}/uploads/${file.filename}`
    return this.success(filePath)
  }
}

export default new UploadService()
